<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="html" uri="http://struts.apache.org/tags-html"%>
<%@ taglib prefix="logic" uri="http://struts.apache.org/tags-logic"%>
<%@ taglib prefix="bean" uri="http://struts.apache.org/tags-bean"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<title>${applicationScope.title }</title>
		<link href="style/style-main.css" type="text/css" rel="stylesheet">
		<script type="text/javascript" src="script/jquery-1.3.1.min.js"></script>
		<script type="text/javascript">
			$(document).ready( function() {
				//some code
				});
		
			function logout() {
			}
		</script>
	</head>

	<body onunload="javascript:logout()">
		<!-- 防止直接访问 -->
		<logic:empty name="userModules" scope="session">
			<logic:redirect href="login.jsp" />
		</logic:empty>
		<!-- S-导航条 -->
		<div id="navigate">
			<ul style="width: 900px;">
				<logic:iterate id="module" name="userModules" scope="session">
					<li>
						<a href="javascript:show('${module.moduleName }')"
							id='${module.moduleName }Link'>${module.displayName }</a>
					</li>
				</logic:iterate>
			</ul>
		</div>
		<!-- E-导航条 -->
		<script type="text/javascript">
			function show(module) {
				//还原所有导航按钮的样式
				$("ul li a").css("background", "#dde").css("border-bottom", "none");
				//设置当前按钮的样式为被选中的
				$("#" + module + "Link").css("background", "white").css(
						"border-bottom", "1px solid white");
				//隐藏所有层(除导航)
				$("div:not(#navigate)").css("display", "none");
				//显示“Loading...”
				$("#loadingLayer").fadeIn("fast");
				//载入模块内容
				$("#contentLayer").load("modules/" + module + ".jsp", function() {
					$("#loadingLayer").fadeOut("fast", function() {
						//载入完毕后显示当前选中的层
						$("#contentLayer").fadeIn("normal");
					});
				});
			}
		</script>
		<!-- S-内容 -->
		<div id="contentLayer" style="display: none;"></div>
		<div id="welcomeLayer">
			welcome：${sessionScope.user.userName }
		</div>
		<div id="loadingLayer" style="display: none; font-size: 16px;">
			<em>Loading...</em>
		</div>
		<!-- E-内容 -->
	</body>
</html>
